
	.extern soc_init
	.extern wdt_disable

	.section .text
	.type   _start, @function
	.global _start
_start:

	/* Setup the global pointer, which the ABI assumes points to the
	 * __global_pointer$ symbol. */
	.option push
	.option norelax
	la      gp, __global_pointer$
	.option pop

	/* Set MTVEC */
	la      t0, _vector_table
	ori     t0, t0, 1
	csrrw   zero, mtvec, t0

	/* Set up the stack pointer */
	la sp,  __stack_top

	/* disable wdt */
	call    wdt_disable

	/* init soc */
	call    soc_init

	/* Clear the bss segment */
	call    bss_clear

	/* Call main */
	call    main
	tail    .
